xen: Provide notification of console updates via VIRQ.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Mar 2007 15:21:10 +0000 (15:21 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Mar 2007 15:21:10 +0000 (15:21 +0000)
The readconsolering capabilities provide the opportunity to
provide console output to other clients (remote systems,
logging systems, etc). This patchs adds the ability to generate
a notification of a change in the console buffer.

Signed-off-by: Ben Thomas <ben@virtualiron.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/common/event_channel.c
xen/drivers/char/console.c
xen/include/public/xen.h

index 2b361f501e9bd6e701e6cb090376e64e2e85fb34..6054527286e75a8ab2d8b08dd696d3798f51dc13 100644 (file)
@@ -560,6 +560,9 @@ void send_guest_global_virq(struct domain *d, int virq)
 
     ASSERT(virq_is_global(virq));
 
+    if ( unlikely(d == NULL) )
+        return;
+
     v = d->vcpu[0];
     if ( unlikely(v == NULL) )
         return;
index 03045963c9d2b1314f3bf2472c689c31f3caada4..927b47112f565cd775d10df6bab65b4d7ec8de2f 100644 (file)
@@ -399,6 +399,8 @@ static void __putstr(const char *str)
         vga_putchar(c);
         putchar_console_ring(c);
     }
+
+    send_guest_global_virq(dom0, VIRQ_CON_RING);
 }
 
 static int printk_prefix_check(char *p, char **pp)
index 3b6e4a8b2b68442e5ac3b512a533d1fecd748fa1..cf00a62e7ac24cddd762e0ab38a3f01353e38bee 100644 (file)
 #define VIRQ_TBUF       4  /* G. (DOM0) Trace buffer has records available.  */
 #define VIRQ_DEBUGGER   6  /* G. (DOM0) A domain has paused for debugging.   */
 #define VIRQ_XENOPROF   7  /* V. XenOprofile interrupt: new sample available */
+#define VIRQ_CON_RING   8  /* G. (DOM0) Bytes received on console            */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16